package kz.pompei.ifacer.main;

import java.awt.event.ActionEvent;

import javax.swing.AbstractAction;

public abstract class AbstractAction1 extends AbstractAction {
  @Override
  public void actionPerformed(ActionEvent e) {
    try {
      run();
    } catch (Exception e1) {
      throw new RuntimeException(e1);
    }
  }
  
  public void execute() {
    try {
      run();
    } catch (Exception e1) {
      throw new RuntimeException(e1);
    }
  }
  
  protected abstract void run() throws Exception;
  
  protected void update() throws Exception {}
  
  public String name() {
    return getClass().getSimpleName();
  }
}
